package IO.stream;

import java.io.IOException;
import java.io.Reader;
import java.io.Writer;

public class CharStream {
    public static void main(String[] args) throws IOException {
        char[] buf = new char[4096];
        Reader r = System.console().reader();
        Writer w = System.console().writer();
        int len = r.read(buf);
        while (len != -1) {
            w.write(buf, 0, len);
            w.flush();
            len = r.read(buf);
        }
    }
}
